
char *reversePrefix(char *word, char ch)
{
    char *cur, *top, tmp;
    cur = top = word;
    while (*cur)
    {
        if (ch == *cur)
        {
            while (top < cur)
            {
                tmp = *top;
                *top = *cur;
                *cur = tmp;
                top++;
                cur--;
            }
            break;
        }
        cur++;
    }
    return word;
}

